/** 
  * @author Ji Ye Choi <cgycgy@naver.com>
  * @version 1.5
  * @since 2010-10-16
  */ 

import java.lang.String;
import java.lang.System;

public class Sorter {
	
	public static void sort(Object[] data, Comparator comp) {
		for(int i = data.length-1; i >= 0; i--) {
			int indexOfMax = 0;
			for(int j = 1; j <= i; j++) {
				if(comp.compare(data[j], data[indexOfMax]) > 0) {
					indexOfMax = j;
				}
			}
			Object temp = data[i];
			data[i] = data[indexOfMax];
			data[indexOfMax] = temp;
			System.out.print(" " + data[i]);
		}
		System.out.println();
	}

	public static void sort(String[] data, Comparator comp) {
                for(int i = data.length-1; i >= 0; i--) {
                        int indexOfMax = 0;
                        for(int j = 1; j <= i; j++) {
                                if(comp.compare(data[j], data[indexOfMax]) > 0) {
                                        indexOfMax = j;
                                }
                        }
                        String temp = data[i];
                        data[i] = data[indexOfMax];
                        data[indexOfMax] = temp;
                        System.out.print(" " + data[i]);
                }
                System.out.println();
        }
}
